package com.xcf.service.business.common.shipformation.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.entity.Page;
import com.xcf.entity.business.common.ShipFormation;
import com.xcf.service.business.common.shipformation.ShipFormationService;
import com.xcf.util.PageData;
@Service("ShipFormationServiceImpl")
public class ShipFormationServiceImpl implements ShipFormationService{
	@Resource(name="daoSupport")
	private DaoSupport daosupport;
	//列表的查询及显示
		@SuppressWarnings("unchecked")
		@Override
		public List<ShipFormation> seach(Page pd) throws Exception {
			
			return (List<ShipFormation>) daosupport.findForList("shipformationmapper.seach", pd);
		}
		
		//查询船名
		@SuppressWarnings("unchecked")
		@Override
		public List<PageData> seachShip() throws Exception {
			
			return (List<PageData>) daosupport.findForList("shipformationmapper.seachShip", "");
		}

		//查询航线
		@SuppressWarnings("unchecked")
		@Override
		public List<PageData> query() throws Exception {
			// TODO Auto-generated method stub
		 return (List<PageData>) daosupport.findForList("shipformationmapper.query", "");
		}

		//新增一条
			@Override
			public void addship(PageData pd) {
				try {
					daosupport.save("shipformationmapper.save", pd);
				} catch (Exception e) {
					
					e.printStackTrace();
				}
				
			}
			//去修改页面
			@Override
			public PageData seacById(PageData pd) throws Exception {
				
				
					return (PageData) daosupport.findForObject("shipformationmapper.seacById", pd);
			}
			
		
			//修改页面的保存
			@Override
			public void updateShip(PageData pd) {
				try {
					daosupport.update("shipformationmapper.editU", pd);
				} catch (Exception e) {
					
					e.printStackTrace();
				}
				
			}

			//查询脱单表
			@Override
			public PageData search(PageData pd) throws Exception {
				return (PageData) daosupport.findForObject("shipformationmapper.search", pd);
				
				
			}

			//查询外贸表
			@Override
			public List<PageData> searchForeign() throws Exception {
				
				return (List<PageData>) daosupport.findForList("shipformationmapper.searchForeign", "");
			}

			@Override
			public List<PageData> searchTrade() throws Exception {
				
				return (List<PageData>) daosupport.findForList("shipformationmapper.searchTrade", "");
			}

			//查询内贸
			@Override
			public List<PageData> DomesticTrade() throws Exception {
				
				return (List<PageData>) daosupport.findForList("shipformationmapper.DomesticTrade", "");
			}

			//查询表里是否存在托单编号
			@SuppressWarnings("unchecked")
			@Override
			public List<PageData> seacByCode(PageData phq) throws Exception {
				
				return (List<PageData>) daosupport.findForList("shipformationmapper.seacByCode", phq);
			}
			//查询付款表里是否存在
			@Override
			public List<PageData> seacByCo(PageData phq) throws Exception {
				// TODO Auto-generated method stub
				return (List<PageData>) daosupport.findForList("shipformationmapper.seacByCo", phq);
			}

			//新增收款 外贸
			@Override
			public void addsForeign(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.addsForeign", phq);
				
			}

			//新增付款 外贸
			@Override
			public void addscope(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.addscope", phq);
				
			}

			//新增收款 外贸
			@Override
			public void addstrade(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.addstrade", phq);
				
			}

			//新增付款 外贸
			@Override
			public void addtrade(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.addtrade", phq);
				
			}
			

			//内贸表收款的新增
			@Override
			public void adddome(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.adddome", phq);
				
			}

			//内贸表付款的新增
			@Override
			public void adddomestic(PageData phq) throws Exception {
				daosupport.save("shipformationmapper.adddomestic", phq);
			}


			//修改收款
			@Override
			public void updateForeign(PageData phq) throws Exception{
				daosupport.update("shipformationmapper.updateForeign", phq);
				
			}

			//修改付款
			@Override
			public void updatescope(PageData phq) throws Exception {
				daosupport.update("shipformationmapper.updatescope", phq);
				
			}

			
			//修改收款
			@Override
			public void updatestrade(PageData phq) throws Exception {
				daosupport.update("shipformationmapper.updatestrade", phq);
				
			}
			//修改付款
			@Override
			public void updatetrade(PageData phq) throws Exception {
				daosupport.update("shipformationmapper.updatetrade", phq);
				
			}

			//修改外贸收款表
			@Override
			public void updatedome(PageData phq) throws Exception {
				daosupport.update("shipformationmapper.updatedome", phq);
				
			}

			//修改外贸付款表
			@Override
			public void updatedomestic(PageData phq) throws Exception {
				daosupport.update("shipformationmapper.updatedomestic", phq);
				
			}

		

			
			
}
